package com.yanqu.road.server.logic.system;

import com.yanqu.road.pb.variety.VarietyProto;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.match.MatchModule;
import com.yanqu.road.server.gameplayer.module.patrons.PatronsModule;
import com.yanqu.road.server.manger.match.MatchMgr;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @author ：zfr
 * @date ：2021/3/4 17:08
 */
public class SystemOpenVariety extends BaseSystemOpen {
    public SystemOpenVariety(int systemId, GamePlayer player) {
        super(systemId, player);
    }

    @Override
    public void initSystem() {
        if (MatchMgr.isMatchSystemOpenTime()) {
            //同步玩家杂艺门客出战次数
            player.getModule(MatchModule.class).syncVarietyPatrons();
            //同步区服分组
            VarietyProto.SyncGroupServerReqMsg.Builder groupServerListSyncMsg = VarietyProto.SyncGroupServerReqMsg.newBuilder();
            player.sendPacket(CrossProtocol.C_VARIETY_SYNC_GROUP_SERVER_LIST, groupServerListSyncMsg);
        }
    }
}
